<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Coupon extends Model
{
    use HasFactory;

    const STATUS_EFFECT = 0;
    const STATUS_USED = 1;
    const STATUS_EXPIRED = -1;

    const STATUS = [
        0 => '未使用',
        1 => '已使用',
        -1 => '已过期',
    ];

    protected $table = 'coupons';
    protected $primaryKey = 'id';
    public $timestamps = true;
    protected $guarded = [];

    protected $casts = [
        'data' => 'array',
    ];


}
